/**
 * f-club.cn
 * Copyright (c) 2009-2012 All Rights Reserved.
 */
package com.mtoolkit.socket;

import java.util.Calendar;

import com.mtoolkit.socket.SocketRequest;
import com.mtoolkit.socket.SocketResponse;
import com.mtoolkit.socket.server.NioServerEventAdapter;

/**
 * 
 * @author michael
 * @version $Id: TimeHandler.java 79 2012-11-05 12:58:10Z xishizhang@gmail.com $
 */
public class TimeHandler extends NioServerEventAdapter {
    
    @Override
    public void onWrite(SocketRequest request, SocketResponse response) {
        Object requestContent = request.getRequestData();
        if ("TIME".equals(requestContent)) {
            response.setResponseData(Calendar.getInstance().getTime() + " by张世喜");
        } else {
            response.setResponseData("Unknow how to process");
        }
    }
    
}
